package com.ibeeking.found.msg.rest.controller.v1.feign;


import com.ibeeking.found.common.entity.msg.MsgSimpleParam;
import com.ibeeking.found.common.entity.msg.MsgTemplateParam;
import com.ibeeking.found.msg.rest.manager.SendMsgManager;
import com.ibeeking.found.msg.service.common.param.MsgNoticeBodyParam;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName SendMsgController控制器
 * @Description 发送消息通知
 * @Author ibeeking
 * @Date 2020-12-09 10:54
 **/
@RestController
@RequestMapping("/msg/send/feign/v1")
public class SendMsgController {

    @Resource
    private SendMsgManager sendMsgManager;

    @Log(logType = OperateLogTypeEnum.SAVE, describe = "发送内容消息")
    @PostMapping(value = "/sendSimpleMessage")
    public Boolean sendSimpleMessage(@RequestBody @Validated MsgSimpleParam param) {
        return sendMsgManager.sendSimpleMessage(param);
    }
    @Log(logType = OperateLogTypeEnum.SAVE, describe = "发送模板消息")
    @PostMapping(value = "/sendTemplateMessage")
    public Boolean sendTemplateMessage(@RequestBody @Validated MsgTemplateParam param) {
        return sendMsgManager.sendTemplateMessage(param);
    }
}
